package net.udp;

import java.net.DatagramPacket;
import java.net.SocketException;

public class LoggingUDPDiscardServer extends UDPSever
{
	public final static int DEFAULT_PORT = 9999;
	public LoggingUDPDiscardServer() throws SocketException
	{
		super(DEFAULT_PORT);
	}
	@Override
	public void respond(DatagramPacket request)
	{
		byte[] data = new byte[request.getLength()];
		System.arraycopy(request.getData(), 0, data, 0, request.getLength());
		try
		{
			String s = new String(data,"8859_1");
			System.out.println(s);
		}
		catch (Exception e)
		{
		}
	}
	public static void main(String[] args)
	{
		try
		{
			UDPSever server = new LoggingUDPDiscardServer();
			server.start();
		}
		catch (Exception e)
		{
		}
	}
}
